Optimal. Leaf size=86 \[ -\frac {3 a^3 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^3 \cot (c+d x)}{d}+\frac {2 a^3 \cos (c+d x)}{3 d (1-\sin (c+d x))^2}+\frac {11 a^3 \cos (c+d x)}{3 d (1-\sin (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {2951, 3855,
3852, 8, 2729, 2727} \begin {gather*} -\frac {a^3 \cot (c+d x)}{d}+\frac {11 a^3 \cos (c+d x)}{3 d (1-\sin (c+d x))}+\frac {2 a^3 \cos (c+d x)}{3 d (1-\sin (c+d x))^2}-\frac {3 a^3 \tanh ^{-1}(\cos (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2727
Rule 2729
Rule 2951
Rule 3852
Rule 3855
Rubi steps
\begin {align*} \int \csc ^2(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x))^3 \, dx &=a^4 \int \left (\frac {3 \csc (c+d x)}{a}+\frac {\csc ^2(c+d x)}{a}+\frac {2}{a (-1+\sin (c+d x))^2}-\frac {3}{a (-1+\sin (c+d x))}\right ) \, dx\\ &=a^3 \int \csc ^2(c+d x) \, dx+\left (2 a^3\right ) \int \frac {1}{(-1+\sin (c+d x))^2} \, dx+\left (3 a^3\right ) \int \csc (c+d x) \, dx-\left (3 a^3\right ) \int \frac {1}{-1+\sin (c+d x)} \, dx\\ &=-\frac {3 a^3 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {2 a^3 \cos (c+d x)}{3 d (1-\sin (c+d x))^2}+\frac {3 a^3 \cos (c+d x)}{d (1-\sin (c+d x))}-\frac {1}{3} \left (2 a^3\right ) \int \frac {1}{-1+\sin (c+d x)} \, dx-\frac {a^3 \text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}\\ &=-\frac {3 a^3 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^3 \cot (c+d x)}{d}+\frac {2 a^3 \cos (c+d x)}{3 d (1-\sin (c+d x))^2}+\frac {11 a^3 \cos (c+d x)}{3 d (1-\sin (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.72, size = 135, normalized size = 1.57 \begin {gather*} \frac {a^3 \left (-3 \cot \left (\frac {1}{2} (c+d x)\right )-18 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+18 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {4}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 \sin \left (\frac {1}{2} (c+d x)\right ) (-13+11 \sin (c+d x))}{\left (-\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}+3 \tan \left (\frac {1}{2} (c+d x)\right )\right )}{6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.27, size = 131, normalized size = 1.52
method | result | size |
derivativedivides | \(\frac {a^{3} \left (\frac {1}{3 \sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}+\frac {4}{3 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {8 \cot \left (d x +c \right )}{3}\right )+3 a^{3} \left (\frac {1}{3 \cos \left (d x +c \right )^{3}}+\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )-3 a^{3} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+\frac {a^{3}}{3 \cos \left (d x +c \right )^{3}}}{d}\) | \(131\) |
default | \(\frac {a^{3} \left (\frac {1}{3 \sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}+\frac {4}{3 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {8 \cot \left (d x +c \right )}{3}\right )+3 a^{3} \left (\frac {1}{3 \cos \left (d x +c \right )^{3}}+\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )-3 a^{3} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+\frac {a^{3}}{3 \cos \left (d x +c \right )^{3}}}{d}\) | \(131\) |
risch | \(\frac {-\frac {58 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}}{3}-18 i a^{3} {\mathrm e}^{3 i \left (d x +c \right )}+\frac {28 a^{3}}{3}+22 i a^{3} {\mathrm e}^{i \left (d x +c \right )}+6 a^{3} {\mathrm e}^{4 i \left (d x +c \right )}}{\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{3} d}+\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}-\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}\) | \(138\) |
norman | \(\frac {\frac {a^{3}}{2 d}-\frac {21 a^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {14 a^{3} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {133 a^{3} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}-\frac {21 a^{3} \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {44 a^{3} \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {21 a^{3} \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {133 a^{3} \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}-\frac {14 a^{3} \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {21 a^{3} \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {a^{3} \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {4 a^{3} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {30 a^{3} \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {26 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{3 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {3 a^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(316\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.36, size = 123, normalized size = 1.43 \begin {gather*} \frac {2 \, {\left (\tan \left (d x + c\right )^{3} - \frac {3}{\tan \left (d x + c\right )} + 6 \, \tan \left (d x + c\right )\right )} a^{3} + 6 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a^{3} + 3 \, a^{3} {\left (\frac {2 \, {\left (3 \, \cos \left (d x + c\right )^{2} + 1\right )}}{\cos \left (d x + c\right )^{3}} - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {2 \, a^{3}}{\cos \left (d x + c\right )^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 334 vs.
\(2 (78) = 156\).
time = 0.37, size = 334, normalized size = 3.88 \begin {gather*} \frac {28 \, a^{3} \cos \left (d x + c\right )^{3} - 10 \, a^{3} \cos \left (d x + c\right )^{2} - 34 \, a^{3} \cos \left (d x + c\right ) + 4 \, a^{3} - 9 \, {\left (a^{3} \cos \left (d x + c\right )^{3} + 2 \, a^{3} \cos \left (d x + c\right )^{2} - a^{3} \cos \left (d x + c\right ) - 2 \, a^{3} - {\left (a^{3} \cos \left (d x + c\right )^{2} - a^{3} \cos \left (d x + c\right ) - 2 \, a^{3}\right )} \sin \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 9 \, {\left (a^{3} \cos \left (d x + c\right )^{3} + 2 \, a^{3} \cos \left (d x + c\right )^{2} - a^{3} \cos \left (d x + c\right ) - 2 \, a^{3} - {\left (a^{3} \cos \left (d x + c\right )^{2} - a^{3} \cos \left (d x + c\right ) - 2 \, a^{3}\right )} \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 2 \, {\left (14 \, a^{3} \cos \left (d x + c\right )^{2} + 19 \, a^{3} \cos \left (d x + c\right ) + 2 \, a^{3}\right )} \sin \left (d x + c\right )}{6 \, {\left (d \cos \left (d x + c\right )^{3} + 2 \, d \cos \left (d x + c\right )^{2} - d \cos \left (d x + c\right ) - {\left (d \cos \left (d x + c\right )^{2} - d \cos \left (d x + c\right ) - 2 \, d\right )} \sin \left (d x + c\right ) - 2 \, d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.59, size = 118, normalized size = 1.37 \begin {gather*} \frac {18 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {3 \, {\left (6 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{3}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {4 \, {\left (15 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 24 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 13 \, a^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.21, size = 144, normalized size = 1.67 \begin {gather*} \frac {3\,a^3\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {-21\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+35\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\frac {61\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}+a^3}{d\,\left (-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________